<?php
include_once("inc/conn.php");
include_once("heheadmin/inc/config.php");
include_once("heheadmin/inc/config.php");
include_once("inc/function.php");

$id=intval($_GET['tj']);
if($id)setcookie('tj',$id);
if (empty($_COOKIE["usersid"]) || empty($_COOKIE["password"])){
	if(isset($_SESSION["usersid"]))
	{
		setcookie("usersid",$_SESSION["usersid"]);
        setcookie("username",$_SESSION["username"]);
        setcookie("password",$_SESSION["password"]);
	}
} else {
    if(!isset($_SESSION['usersid']))
    {
        $username = str_check($_COOKIE["username"]);
        $pwd = str_check($_COOKIE["password"]);
        
        $username = (strlen($username) > 50) ? substr($username,0,50) : $username;
        $pwd = (strlen($pwd) > 32) ? substr($pwd,0,32) : $pwd;
        
        $ip = usersip();
        $sql = "call web_user_login('{$username}','{$pwd}','{$ip}')";
        $arr = $db->Mysqli_Multi_Query($sql);
        if($arr[0][0]["result"] == '0'){
            $_SESSION["usersid"] = $arr[0][0]["userid"];
            $_SESSION["username"] = $arr[0][0]["username"];
            $_SESSION["nickname"] = $arr[0][0]["nickname"];
            $_SESSION["points"] = $arr[0][0]["points"];
            $_SESSION["bankpoints"] = $arr[0][0]["bankpoint"];
            $_SESSION["exp"] = $arr[0][0]["experience"]; 
            $_SESSION['freeze'] = 0;
        }
        else
        {
             unset($_SESSION['usersid']);
             session_destroy();    
        }
    }
    RefreshPoints();
    if(isset($_SESSION['freeze']) && $_SESSION['freeze'] == 1)
	{
		//退出
		session_destroy();
	}
}

 echo $_SESSION['vcode'];
?>
<!Doctype html>
<html lang="zh-cn">
<head>
    <title>保时捷28,蛋蛋28,加拿大28,幸运28,PC蛋蛋,<?php echo $web_name;?></title>
    <?php
    require 'public/title.inc_yj.php';
    ?>
    <link rel="stylesheet" type="text/css" href="style/yj_index.css" />
    <script type="text/javascript" src="js/login.js"></script>
    <script type="text/javascript" src="js/flux.min.js"></script>
    <script type="text/javascript" charset="utf-8">
    $(function(){
            window.f = new flux.slider('#slider', {
                pagination: false,
                transitions: ['slide']   
            });
    });
    </script>
</head>

<body>
<?php include_once("top2.php");?>
<div id="slider" class="flexslider">
    <ul class="slides" id="slidesDom">
        <?php if($yj_config[5]){?>
        <li style="position: absolute; left: 0px; top: 0px;"> 
            <a title="" href="<?php echo $yj_config[5]['yj_url'] ?>">        
                <img width="1920" height="482" alt="" src="<?php echo $yj_config[5]['yj_value'] ?>">
            </a>
        </li>
        <?php }?>
        <?php if($yj_config[6]){?>
        <li style="position: absolute; left: 0px; top: 0px;"> 
            <a title="" href="<?php echo $yj_config[6]['yj_url'] ?>">        
                <img width="1920" height="482" alt="" src="<?php echo $yj_config[6]['yj_value'] ?>">
            </a>
        </li>
        <?php }?>
    </ul>
    <ul class="flex-direction-nav" style="display: none;">
        <li><a class="flex-prev" href="javascript:;">Previous</a></li>
        <li><a class="flex-next" href="javascript:;">Next</a></li>
    </ul>
    <ol id="bannerCtrl" class="flex-control-nav flex-control-paging" style="display: none;">
        <li class="active"><a>1</a></li>
    </ol>
</div>

<div class="mc-section index-content">
    <div class="message" style="display: none;">
        <ul id="scrollText" style="position: absolute; left: 36px; float: left; overflow: hidden; top: -40px;">
            <li style="overflow:hidden;text-overflow:ellipsis;white-space: nowrap;">每个对应的IP, 银行卡,名字. 只能参与一次登录奖励活动, 如有发现多号领取登录奖励者,一律封号处理.</li>
        </ul>
        <ul id="swap" style="position: absolute; left: 36px; float: left; overflow: hidden; top: 0px;">
            <li style="overflow:hidden;text-overflow:ellipsis;white-space: nowrap;">每个对应的IP, 银行卡,名字. 只能参与一次登录奖励活动, 如有发现多号领取登录奖励者,一律封号处理.</li>
        </ul>
    </div>
    <div class="modal-section hotGmae clearfix">
        <div class="left-section fl">
            <div class="header clearfix">
                <div class="left fl clearfix">
                    <div class="line fl"></div>
                    <span class="fl">热门游戏</span>
                </div>
                <a href="game.php" class="right fr">更多
                    <span class="addIcon">+</span>
                </a>
            </div>
            <div class="gameList clearfix">
                <a href="game.php" data-game="8" class="item">
                    <img src="img/59d3a5cd30126.jpg" alt="" class="imgScale">  <div class="hotTags"></div>    
                    <div class="gameText clearfix">        
                        <div class="leftName fl">加拿大28</div>        
                        <div class="rightEnter fr">进入游戏 &gt;&gt;</div>    
                    </div>
                </a>
                <a href="game.php" data-game="4" class="item">    
                    <img src="img/59d3a5a739667.jpg" alt="" class="imgScale">    
                    <div class="hotTags"></div>    
                    <div class="gameText clearfix">        
                        <div class="leftName fl">蛋蛋28</div>        
                        <div class="rightEnter fr">进入游戏 &gt;&gt;</div>    
                    </div>
                </a>
            </div>
        </div>
        <div class="right-section fr">
            <div class="header clearfix">
                <div class="left fl clearfix">
                    <div class="line fl"></div>
                    <span class="fl">新闻公告</span>
                </div>
                <a href="javascript:;" class="right fr">更多
                    <span class="addIcon">+</span>
                </a>
            </div>
            <div class="noticeList">
                 <?
                    $i=0;
                    $query=$db->query("Select id,title,content from news Order by top desc,id desc limit 3");
                    while($rs=$db->fetch_array($query)){
                        $i++;
                ?>
                <a class="importantNotice" href="news.php?id=<?=$rs["id"]?>">
                    <div class="title"><?=ChangeEncodeG2U($rs["title"])?></div>
                    <div class="content">
                        <p><?=ChangeEncodeG2U($rs["content"])?></p>
                    </div>
                </a>
                <?
                    }
                ?>
                <ul class="noticeUl"></ul>
            </div>
        </div>
        <div class="right"></div>
    </div>
    <div class="modal-section activeReward clearfix">
        <div class="active-contain fl">
            <div class="header clearfix">
                <div class="left fl clearfix">
                    <div class="line fl"></div>
                    <span class="fl">活动福利</span>
                </div>
                <a href="active.php" class="right fr">更多
                    <span class="addIcon">+</span>
                </a>
            </div>
            <div class="activeList clearfix">
                <?php
                    //活动数据
                    $_result = $db->query("SELECT tg_title,tg_img,tg_content,tg_start_time,tg_last_time FROM game_active WHERE tg_active = 1 ORDER BY tg_top DESC");
                    $_html = array();
                    $i = 0;
                    while($rs = $db->fetch_array($_result)) {
                        $_html['title'] = $rs['tg_title'];
                        $_html['img'] = $rs['tg_img'];
                        $_html['content'] = $rs['tg_content'];
                        $_html['start_time'] = $rs['tg_start_time'];
                        $_html['last_time'] = $rs['tg_last_time'];
                    
                ?>
                <a href="javascript:;" class="item indexAct" data-type="<?php echo $i; ?>">    
                    <img src="<?php echo $_html['img']; ?>" alt="">    
                    <div class="activeText"><?php echo $_html['title'];?></div>
                </a>
                <span class="activeContent" style="display: none;"><?php echo $_html['content'];?></span>
                <?php
                    $i++;
                }
            ?>
            </div>
        </div>
    </div>
    <div class="modal-section partner clearfix" style="display: none;">
        <div class="partner-contain fl">
            <div class="header clearfix">
                <div class="left fl clearfix">
                    <div class="line fl"></div>
                    <span class="fl">合作伙伴</span>
                </div>
                <a href="javascript:;" class="right fr">更多
                    <span class="addIcon">+</span>
                </a>
            </div>
            <div class="partner-list">
                <div class="item"><img src="img/partner1.png" alt=""></div>
                <div class="item"><img src="img/partner2.png" alt=""></div>
                <div class="item"><img src="img/partner3.png" alt=""></div>
                <div class="item"><img src="img/partner4.png" alt=""></div>
                <div class="item"><img src="img/partner5.png" alt=""></div>
                <div class="item"><img src="img/partner6.png" alt=""></div>
                <div class="item"><img src="img/partner7.png" alt=""></div>
                <div class="item noMgRt"><img src="img/partner8.png" alt=""></div>
            </div>
        </div>
    </div>
</div>
<?php
require 'yj_footer.php';
?>
<script type="text/javascript">
    $(".indexAct").on("click", function() {
        var a = Number($(this).attr("data-type"));
        var title = $('.activeText')[a].innerHTML;
        var content = $('.activeContent')[a].innerHTML;
        var dom = '<div class="msgModal">' + '<div class="msgtitle">' + title + '<span class="msgModalClose"></span></div>' + '<div class="msgcol1">' + content + "</div>" + "</div>";
        $("body").append(dom).css("overflow", "hidden");
        $(".msgModalClose").on("click", function() {
            $(".msgModal").remove();
            $("body").css("overflow", "auto")
        })
    })
</script>
</body>
</html>


